﻿@model ProjectManagement.Models._TaskComment
@using Projectmanagement.Entity
@using Projectmanagement.Utl;

<style>
    .taskdetail input{width: 250px;}
</style>

<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />

@using (Html.BeginForm("AddComment", "Task"))
{
    Task task = Model.GetTask;
    //任务详细
    <table class="noline taskdetail" style="text-align: left; width:100%;margin-bottom: 20px;">
        <tr>
            <td>任务名称</td>
            <td><input type="text" value="@task.Name" disabled="disabled"/></td>
            <td>倒推天数</td>
            <td><input type="text" value="@task.DateCount" disabled="disabled"/></td>
        </tr>
        <tr>
            <td>开始时间</td>
            <td><input type="text" value="@task.StartDate" disabled="disabled"/></td>
            <td>结束时间</td>
            <td><input type="text" value="@task.EndDate" disabled="disabled"/></td>
        </tr>
        <tr>
            <td>任务执行人</td>
            <td><input type="text" value="@task.Owners" disabled="disabled"/></td>
            <td>总天数</td>
            <td><input type="text" value="@task.Duration" disabled="disabled"/></td>
        </tr>
        <tr>
            <td>可交付成果</td>
            <td><input type="text" value="@task.Deliverables" disabled="disabled"/></td>
            @*<td>完成度</td>
            <td><input type="text" value="@task.Complement" disabled="disabled"/></td>*@
        </tr>
        <tr>
            <td>内容</td>
            <td colspan="3"><textarea disabled="disabled" rows="4" cols="80">@task.Content</textarea></td>
        </tr>
        <tr>
            <td>知识库链接</td>
            <td colspan="3"><textarea disabled="disabled" rows="4" cols="80">@task.KMLinks</textarea></td>
        </tr>
    </table>
    
    
    <!-- add commment -->
    @Html.HiddenFor(model => model.TaskID)
    <table style="text-align:left; width:100%;">
        <tr>
            <td>
                @Html.LabelFor(model => model.Contents)
            </td>
            <td style="width:88%;">
                @Html.TextAreaFor(model => model.Contents, new { rows="4" ,cols="80"})<br />
                @Html.ValidationMessageFor(model => model.Contents)
            </td>
        </tr>
    </table>
    
    <input type="button" value="提交" class="t-button" onclick="AddComment()" />
    <input type="button" value="取消" class="t-button" onclick="CancelAddComment()" />
     <!-- comments list -->
    <div class="dierye_3" style="overflow-y: scroll; height:216px;font-size:0.8em;">
    @{
        if (ViewBag.tcs != null)
        {
            foreach (var item in ViewBag.tcs)
            {
                bool mysel = Employee.CurrentUserName == item.Submitter;
                if (mysel)
                {
                    <table style="border: 0; float:right;" class="all allR">
                        <tr>
                            <td class="RoundedCorner" style="padding:0px">
                                <b class="rtop opacity whiteB">
                                    <b class="r1 opacity whiteB"></b>
                                    <b class="r2 opacity whiteB"></b>
                                    <b class="r3 opacity whiteB"></b>
                                    <b class="r4 opacity whiteB"></b>
                                </b>
                                <div class="contert whiteB shadowR">
                                    <p style="float:left;">@item.Contents</p>
                                    <p style="clear:both;">
                                    @(item.CommentDate.ToString("yyyy/MM/dd") + " " + item.CommentDate.ToShortTimeString())
                                    </p>
                                </div>
                                <b class="rbottom opacity whiteB">
                                        <b class="r4 opacity whiteB"></b>
                                        <b class="r3 opacity whiteB"></b>
                                        <b class="r2 opacity whiteB"></b>
                                        <b class="r1 opacity whiteB"></b>
                                </b>
                            </td>
                            <td  style="padding:0px;vertical-align:middle;width:18px">
                                <div class="str whiteStr"></div>
                            </td>
                            <td style="padding:0px;vertical-align:middle">
                                我
                            </td>
                        </tr>
                    </table>
                }
                else 
                {
                    <table style="border: 0;" class="all allL">
                        <tr>
                            <td style="padding:0px;vertical-align:middle; text-align:right">
                                @item.Submitter
                            </td>
                        <td style="padding:0px;vertical-align:middle;width:16px">
                            <div class="str blueStr"></div>
                        </td>
                        <td style="padding:0px; min-width:150px">
                            <b class="rtop opacity blueB">
                                <b class="r1 opacity blueB"></b>
                                <b class="r2 opacity blueB"></b>
                                <b class="r3 opacity blueB"></b>
                                <b class="r4 opacity blueB"></b>
                            </b>
                            <div class="contert blueB shadowL">
                                <p style="float:left;">@item.Contents</p>
                                <p style="clear:both;">
                                @(item.CommentDate.ToString("yyyy/MM/dd") + " " + item.CommentDate.ToShortTimeString())
                                </p>
                            </div>
                            <b class="rbottom opacity blueB">
                                <b class="r4 opacity blueB"></b>
                                <b class="r3 opacity blueB"></b>
                                <b class="r2 opacity blueB"></b>
                                <b class="r1 opacity blueB"></b> 
                            </b>         
                        </td>
                        </tr>
                    </table>
                }
            }
        }
    }
    </div>
}